import ajax from '@lib/ajax';

const URL = "my/profile";

interface IRequest {
	display_id: string;
	bilibili_id: string;
	nga_id: string;
	weibo_id: string;
}

export default async function(req: IRequest) {
	const res = await ajax({
		url: URL,
		post: req
	});
	if (res.success) {
		const data = res.data;
		return data;
	} else {
		return new Error(res.error);
	}
}